// -*- C++ -*-
-// $Id: babeldata.h,v 1.2 2009/07/31 18:32:32 robertl Exp $
+// $Id: babeldata.h,v 1.3 2009/08/03 05:16:23 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
#include <QSettings>
#include <QStringList>
+#include <QUuid>
#include "setting.h"
outputBrowse(QString()),
previewGmap(false),
upgradeCheckMethod(0),
- upgradeCheckTime(QDateTime(QDate(2001, 1, 1), QTime(0, 0)))
+ upgradeCheckTime(QDateTime(QDate(2001, 1, 1), QTime(0, 0))),
+ installationUuid(QUuid::createUuid().toString())
{
};
sg.addVarSetting(new BoolSetting("app.previewGmap", previewGmap));
sg.addVarSetting(new IntSetting("app.upgradeCheckMethod", upgradeCheckMethod));
sg.addVarSetting(new DateTimeSetting("app.upgradeCheckTime", upgradeCheckTime));
+ sg.addVarSetting(new StringSetting("app.installationUuid", installationUuid));
}
static const int noType;
bool previewGmap;
int upgradeCheckMethod;
QDateTime upgradeCheckTime;
+ QString installationUuid;
};
// -*- C++ -*-
-// $Id: mainwindow.cpp,v 1.2 2009/07/31 18:32:32 robertl Exp $
+// $Id: mainwindow.cpp,v 1.3 2009/08/03 05:16:23 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
//--- Restore from registry
restoreSettings();
upgrade = new UpgradeCheck();
- upgrade->checkForUpgrade(babelVersion, bd.upgradeCheckMethod, bd.upgradeCheckTime);
+ upgrade->checkForUpgrade(babelVersion, bd.upgradeCheckMethod, bd.upgradeCheckTime, bd.installationUuid);
}
//------------------------------------------------------------------------
// -*- C++ -*-
-// $Id: upgrade.cpp,v 1.2 2009/07/31 18:32:32 robertl Exp $
+// $Id: upgrade.cpp,v 1.3 2009/08/03 05:16:23 robertl Exp $
/*
Copyright (C) 2009 Robert Lipe, robertlipe@gpsbabel.org
#include "upgrade.h"
#include <QHttp>
+//#include <QHttpRequestHeader>
#include <QMessageBox>
#include <QDomDocument>
-//static const bool testing = true;
-static const bool testing = false;
+static const bool testing = true;
+// static const bool testing = false;
static int versionAsNumber(const QString &s)
{
UpgradeCheck::updateStatus UpgradeCheck::checkForUpgrade(const QString ¤tVersion,
int checkMethod,
- const QDateTime &lastCheckTime)
+ const QDateTime &lastCheckTime,
+ const QString &installationUuid)
{
this->currentVersion = currentVersion;
this->upgradeCheckMethod = checkMethod;
connect(http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)),
this, SLOT(readResponseHeader(const QHttpResponseHeader &)));
+ QHttpRequestHeader header("POST", "/upgrade_check.html");
+ header.setValue("Host", "www.gpsbabel.org");
+ header.setContentType("application/x-www-form-urlencoded");
+ QString args = "current_version=" + currentVersion;
+ args += "&installation=" + installationUuid; header.setValue("Host", "www.gpsbabel.org");
+
http->setHost("www.gpsbabel.org");
- httpRequestId = http->get("/updates.xml");
-
+// http->request(header);
+ http->request(header, args.toUtf8());
+// httpRequestId = http->get("/upgrade_check.html");
+
return UpgradeCheck::updateUnknown;
}
UpgradeCheck::updateStatus checkForUpgrade(const QString &babelVersion,
int upgradeCheckMethod,
- const QDateTime &lastCheckTime);
+ const QDateTime &lastCheckTime,
+ const QString &installationUuid);
QDateTime getUpgradeWarningTime() {
return upgradeWarningTime;
}